有1个列表lst = [1, 4, 9, 16, 2, 5, 10, 15]，生成1个新列表，要求新列表元素是lst相邻2项的和

lst = [1, 4, 9, 16, 2, 5, 10, 15]
a = []
for   i  in   range(1,len(lst)):
    a.append(lst[i] + lst[i-1])
print(a)

lst = [1, 4, 9, 16, 2, 5, 10, 15]
a = []
for i  in  range(len(lst)-1):
    a.append(lst[i] + lst[i+1])
print(a)

lst = [1, 4, 9, 16, 2, 5, 10, 15]
a = []
for i in range(len(lst)-1):
    a.insert(i, lst[i] + lst[i+1])
print(a)

lst = [1,4,9,16,2,5,10,15]
s = []
for i in range(len(lst)):
    if i == len(lst) - 1:
        break
    s.append(lst[i] + lst[i + 1])
	
	
#后期还能改，就是没时间弄了 哈哈	
a = 'qwertyuiopasdfghjklzxcvbnm'

for i in range(1,101):
    b = random.choices(a, k=10)
    b1 = ''.join(b)
    c ='{:0>6}.{}'.format(i, b1)
    print(c)



#今日练习题 ：生成 200个xxxxx-xxxxx-xxxxx-xxxxx 格式的激活码，统计每个字符出现的次数
import random

a = []
b = {}
for i in range(65, 91):
    a.append(chr(i))
for x in range(97, 123):
    a.append(chr(x))
def sm(a):    
    for y in range(5):
        a = ''.join(random.choices(a, k=24))
        t = ''
        for i in range(len(a)):
            if i % 6 == 0:
                t += '-'
            else:
                t += a[i]
        return t.strip('-')
    
    
for i in range(20):
    mi = sm(a)
    print(mi)
    for r in mi:
        b[r] = b.get(r, 0) + 1
    print(b)
    b.clear()




